﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Laboration1Uppgift4.View
{
    public class Camera
    {
        private int _borderSize, _ballSize, _gameWidth;
         

        /// <summary>
        /// Konstruktor
        /// </summary>
        public Camera(int borderSize, int width, float radie)
        { 
            this._borderSize = borderSize;
            _gameWidth = width - borderSize * 2;
            _ballSize = (int)(_gameWidth * (radie * 2));
        }

        /// <summary>
        /// Konvertera till från logiska till visuella koordinater
        /// </summary> 
        public Vector2 GetCoordinates(Vector2 ballPosition)
        {  
            return new Vector2
            {
                X = _borderSize + ballPosition.X * (_gameWidth - _ballSize * 1.5F),
                Y = _borderSize + ballPosition.Y * (_gameWidth - _ballSize * 1.5F)
            };
        }



    }
}
